package com.example.duanjunjie.learn.wk;


/**
 * Created by duanjunjie on 2018/7/23.
 */
public class WKMessageListenerDefault implements WKMessageListener {
    @Override
    public WKNoticeMessageParser renderParser() {
        return new WKNoticeMessageParser() {
            @Override
            public boolean canParse(WKNoticeMessagePacket packet) {
                return checkMessageType(packet.type);
            }

            @Override
            public IWKNoticeMessageData parse(WKNoticeMessagePacket packet) {
                return parsePacket(packet);
            }
        };
    }

    @Override
    public void onReceiveWuKongMessage(WKNoticeMessageBase message) {

    }

    @Override
    public void onWKConnectLost() {

    }

    @Override
    public void onWKConnectEstablished() {

    }

    private boolean checkMessageType(int type) {
        boolean canParse = false;
        switch (type) {
            default:
                break;

        }
        return canParse;
    }

    private IWKNoticeMessageData parsePacket(WKNoticeMessagePacket packet) {
        IWKNoticeMessageData message = null;
        return message;
    }
}
